package com.xf.day05

import org.apache.spark.{SparkConf, SparkContext}

object TestUnion {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
      .setAppName("WordCount")
      .setMaster("local[1]")
      .set("spark.ui.port", "8080")
      .set("spark.driver.host", "127.0.0.1")

    // 创建 SparkContext 对象
    val sc = new SparkContext(conf)
    val rdd6=sc.parallelize(List((1,3),(4,5)))
    val rdd7=sc.parallelize(List((2,3),(3,6),(5,4),(6,8)))
    val result=rdd6.union(rdd7)
    val res :  Array[(Int,Int)] = result.collect()
    println(res.toBuffer)

  }
}
